package design.patterns.behavioral.observer;

import javax.security.auth.Subject;
import java.util.Observable;
import java.util.Observer;

/**
 * @author gjx
 * @version v1.0
 * @Description
 * @date 2019/4/11 9:36
 */
public class Blog extends Observable {

    @Override
    public synchronized void addObserver(Observer o) {
        super.addObserver(o);
    }


    public void addBlog(){
        System.out.println("增加一篇新博客");
        setChanged();
        notifyObservers();
    }
}
